package cn.wanda.bi.sunshine.platform.server.client;

import cn.wanda.bi.sunshine.platform.server.client.request.AuthRequest;
import cn.wanda.bi.sunshine.platform.server.client.request.IMCAuthRequest;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by wangfupeng1
 */
@FeignClient(name = "imc", url = "${dauth.uri:}")
public interface IMCClient {

    //万信登录校验
    @RequestMapping(method = {RequestMethod.POST}, value = {"/v1/auth/user"})
    String v1AuthUser(
            @RequestBody IMCAuthRequest request
    );

    //校验token
    @RequestMapping(method = {RequestMethod.GET}, value = {"/v1/auth/user/check/{token}"})
    String v1AuthUserCheckToken(
            @PathVariable(value="token") String token
    );

    //校验token和path
    @RequestMapping(method = {RequestMethod.GET}, value = {"/v1/auth/user/access/{token}"})
    String v1AuthUserAccessToken(
            @PathVariable(value="token") String token,
            @RequestParam(value="path") String path
    );
}
